﻿using Microsoft.EntityFrameworkCore;
using NewRetail.Application.Components.PrintTask.Entity;
using NewRetail.Application.Core.Entity;

namespace NewRetail.Application.Components.PrintTask
{
    public static class PrintAuthorizationCodeTaskExtension
    {
        public static void ConfigurePrintAuthorizationCodeTaskEntities(this ModelBuilder modelBuilder)
        {
            //打印收银员授权码任务表
            var infoBuilder = modelBuilder.Entity<PrintAuthorizationCodeTaskEntity>().ConfigBaseEntity();
            infoBuilder.ToTable("print_authorization_code_task");
            infoBuilder.Property(x => x.warehouseID).IsRequired();
            infoBuilder.Property(x => x.cashierName).IsRequired();
            infoBuilder.Property(x => x.authorizationCode).IsRequired();
            infoBuilder.Ignore(x => x.Warehouse);
        }
    }
}
